package com.han.hotelplat.pojo.employee;

import java.util.Date;
import java.util.Iterator;
import java.util.Map;

import com.alibaba.druid.sql.visitor.functions.Substring;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.han.hotelplat.comm.utils.DateUtil;
import com.han.hotelplat.model.AreaModel;

/**
 * Employee entity. @author MyEclipse Persistence Tools
 */

public class Employee implements java.io.Serializable {

	// Fields

	private Integer id;
	private String userid;
	private String username;
	private String password;
	private String realname;
	private String icon;
	private Integer sex;
	private String tel;
	private String qq;
	private String wx;
	private String area;
	private String address;
	private Float workyears;
	private String emergencyuser;
	private String emergencytel;
	private String introduceriname;
	private String introduceritel;
	private String facepic;
	private String backpic;
	private Integer state;
	private String remark;
	private Integer level;
	private String wxuid;
	private String qquid;
	private Date creattime;
	private Date lastlogintime;
	private String bankcard;//银行卡列表
	private String idcard;//身份证号码
	private String token;
	private String bindcount;//银行卡绑定次数
	private String pushkey;//推送用
	private Integer clientype;//客户端类型1IOS，2android
	
	// Constructors

	private String bankcardtype;
	private String bankcardno;
	private String bankcode;
	
	private AreaModel[] areaModel ;
	
	private Float roomcount;
	
	private Integer age;//年龄(通过身份证号码计算)
	private Float balance;
	
	private String stringUid;
	private int servercount;//服务某个酒店的次数

	
	/** default constructor */
	public Employee() {
	}
	
	/** full constructor */
	public Employee(String userid, String username, String password,
			String realname, String icon, Integer sex, String tel, String qq,
			String wx, String area, String address, Float workyears,
			String emergencyuser, String emergencytel, String introduceriname,
			String introduceritel, String facepic, String backpic,
			Integer state, String remark, Integer level, String wxuid,
			String qquid,Date creattime, Date lastlogintime, String bankcard, 
			String idcard, String bindcount, String pushkey, Integer clientype) {
		this.userid = userid;
		this.username = username;
		this.password = password;
		this.realname = realname;
		this.icon = icon;
		this.sex = sex;
		this.tel = tel;
		this.qq = qq;
		this.wx = wx;
		this.area = area;
		this.address = address;
		this.workyears = workyears;
		this.emergencyuser = emergencyuser;
		this.emergencytel = emergencytel;
		this.introduceriname = introduceriname;
		this.introduceritel = introduceritel;
		this.facepic = facepic;
		this.backpic = backpic;
		this.state = state;
		this.remark = remark;
		this.level = level;
		this.wxuid = wxuid;
		this.qquid = qquid;
		this.creattime = creattime;
		this.lastlogintime = lastlogintime;
		this.bankcard = bankcard;
		this.idcard = idcard;
		this.bindcount = bindcount;
		this.pushkey = pushkey;
		this.clientype = clientype;
	}

	
	public Employee(Integer id, String userid, String realname,Integer sex, Float workyears,
			String area, Integer state,String tel, Float balance, String idcard, String bankcard){
		this.id=id;
		this.userid= userid;
		this.realname = realname;
		this.sex = sex;
		this.workyears = workyears;
		this.area = area;
		this.state =state;
		this.tel = tel;
		this.balance = balance;
		this.idcard = idcard;
		this.bankcard = bankcard;
	}
	
	public Employee(Integer id, String userid, String realname,Integer sex, Float workyears,
			String area, Integer state,String tel, Float balance, String idcard, String bankcard, Date creattime){
		this.id=id;
		this.userid= userid;
		this.realname = realname;
		this.sex = sex;
		this.workyears = workyears;
		this.area = area;
		this.state =state;
		this.tel = tel;
		this.balance = balance;
		this.idcard = idcard;
		this.bankcard = bankcard;
		this.creattime = creattime;
	}
	
	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUserid() {
		return this.userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealname() {
		return this.realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getIcon() {
		return this.icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public Integer getSex() {
		return this.sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public String getTel() {
		return this.tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getQq() {
		return this.qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getWx() {
		return this.wx;
	}

	public void setWx(String wx) {
		this.wx = wx;
	}

	public String getArea() {
		return this.area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Float getWorkyears() {
		return this.workyears;
	}

	public void setWorkyears(Float workyears) {
		this.workyears = workyears;
	}

	public String getEmergencyuser() {
		return this.emergencyuser;
	}

	public void setEmergencyuser(String emergencyuser) {
		this.emergencyuser = emergencyuser;
	}

	public String getEmergencytel() {
		return this.emergencytel;
	}

	public void setEmergencytel(String emergencytel) {
		this.emergencytel = emergencytel;
	}

	public String getIntroduceriname() {
		return this.introduceriname;
	}

	public void setIntroduceriname(String introduceriname) {
		this.introduceriname = introduceriname;
	}

	public String getIntroduceritel() {
		return this.introduceritel;
	}

	public void setIntroduceritel(String introduceritel) {
		this.introduceritel = introduceritel;
	}

	public String getFacepic() {
		return this.facepic;
	}

	public void setFacepic(String facepic) {
		this.facepic = facepic;
	}

	public String getBackpic() {
		return this.backpic;
	}

	public void setBackpic(String backpic) {
		this.backpic = backpic;
	}

	public Integer getState() {
		return this.state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Integer getLevel() {
		return this.level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public String getWxuid() {
		return this.wxuid;
	}

	public void setWxuid(String wxuid) {
		this.wxuid = wxuid;
	}

	public String getQquid() {
		return this.qquid;
	}

	public void setQquid(String qquid) {
		this.qquid = qquid;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public Date getCreattime() {
		return creattime;
	}

	public void setCreattime(Date creattime) {
		this.creattime = creattime;
	}

	public Date getLastlogintime() {
		return lastlogintime;
	}

	public void setLastlogintime(Date lastlogintime) {
		this.lastlogintime = lastlogintime;
	}

	public String getBankcard() {
		return bankcard;
	}

	public void setBankcard(String bankcard) {
		this.bankcard = bankcard;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}
	
	public void setBankcardno(String bankcardno) {
		this.bankcardno = bankcardno;
	}

	public AreaModel[] getAreaModel() {
		return areaModel;
	}

	public void setAreaModel(AreaModel[] areaModel) {
		this.areaModel = areaModel;
	}

	public Float getRoomcount() {
		return roomcount;
	}

	public void setRoomcount(Float roomcount) {
		this.roomcount = roomcount;
	}

	public Integer getAge() {
		if(this.idcard == null){
			return 0;
		}
		try{
			String birthDayStr = getIdcard().substring(6, 14);//取出出生年月
			
			Date birthday = DateUtil.parseymd(birthDayStr);
			return DateUtil.getYear(new Date())-DateUtil.getYear(birthday)+1;
		}catch(Exception e){
			return 0;
		}
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Float getBalance() {
		return balance;
	}

	public void setBalance(Float balance) {
		this.balance = balance;
	}

	public String getStringUid() {
		return userid.toString();
	}

	public void setStringUid(String stringUid) {
		this.stringUid = stringUid;
	}

	public void setBankcode(String bankcode) {
		this.bankcode = bankcode;
	}


	public String getBindcount() {
		return bindcount;
	}


	public void setBindcount(String bindcount) {
		this.bindcount = bindcount;
	}
	
	public int getServercount() {
		return servercount;
	}

	public void setServercount(int servercount) {
		this.servercount = servercount;
	}


	public String getPushkey() {
		return pushkey;
	}


	public void setPushkey(String pushkey) {
		this.pushkey = pushkey;
	}


	public Integer getClientype() {
		return clientype;
	}


	public void setClientype(Integer clientype) {
		this.clientype = clientype;
	}

	public String getBankcardtype() {
		return bankcardtype;
	}

	public void setBankcardtype(String bankcardtype) {
		this.bankcardtype = bankcardtype;
	}

	public String getBankcardno() {
		return bankcardno;
	}

	public String getBankcode() {
		return bankcode;
	}
	
	
}